fix(FR-2824): move CSV export to BAITable bottom-right in resource policy lists#7366
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage Report for react-coverage (./react)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
This PR updates the three “resource policy list” table components to use BAITable’s built-in CSV export UI (bottom-right, next to pagination controls) instead of a separate top-right “ellipsis” dropdown export button.
Changes:
- Removed the top-right Dropdown/ellipsis export button in the resource policy list headers.
- Added
exportSettingsto each BAITable instance and routed export actions through the BAITable CSV export modal. - Updated CSV export handlers to accept a
selectedExportKeyslist (from the export modal) and export only the chosen fields.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| react/src/components/UserResourcePolicyList.tsx | Switches CSV export trigger to BAITable exportSettings and exports selected fields. |
| react/src/components/ProjectResourcePolicyList.tsx | Same migration to BAITable export UI with selected-field export. |
| react/src/components/KeypairResourcePolicyList.tsx | Same migration to BAITable export UI with selected-field export. |
da35478 to
70c7151
Compare
Merge activity
|
…licy lists (#7366) Resolves #7366 (FR-2824) ## Summary Migrate the resource-policy lists (Keypair / User / Project) from the legacy `pagination.extraContent` + `TableColumnsSettingModal` column-settings setup to the canonical `BAITable` `tableSettings` prop, so the footer renders the same `[total, pagination, page size, ⚙ column-settings, ⋮ export]` order as the rest of the app (`UserManagement`, `AutoScalingRuleList`, etc.). ## Background The earlier version of this PR added `exportSettings` to `BAITable` for the CSV-export ⋮ menu, but kept the legacy `pagination.extraContent` button rendering a separate ⚙ column-settings icon. Because `extraContent` is appended after `exportSettings`, the footer ended up as `[..., ⋮ export, ⚙ column-settings]` — opposite of every other table in the app. Reviewer pointed out the inconsistency. ## Changes For each of `react/src/components/{KeypairResourcePolicyList,UserResourcePolicyList,ProjectResourcePolicyList}.tsx`: - Removed `useHiddenColumnKeysSetting` + `TableColumnsSettingModal` + the `useToggle()` modal state. - Removed the `pagination.extraContent` ⚙ button. - Removed manual `_.filter(columns, …hiddenColumnKeys…)` column filtering. - Added `useBAISettingUserState('table_column_overrides.<ListName>')` to source `columnOverrides` / `setColumnOverrides`. - Passed them to `BAITable` via `tableSettings={{ columnOverrides, onColumnOverridesChange }}` (matches `UserManagement.tsx:487` exactly). - Kept the already-added `exportSettings={{ supportedFields, onExport }}`. `BAITable` then renders the canonical footer ordering automatically. ## Test plan - [ ] Open **Resource Policy → Keypair Resource Policy** tab. Footer shows `[total, pagination, page size, ⚙, ⋮]`. Click ⚙ to toggle column visibility — state persists across reloads (BAI user-state). Click ⋮ → ExportCSV — downloads with the visible columns. - [ ] Repeat for **User Resource Policy** tab. - [ ] Repeat for **Project Resource Policy** tab. - [ ] `bash scripts/verify.sh` — Relay / Lint / Format / TypeScript pass for the modified files (pre-existing TS errors in unrelated files remain). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
70c7151 to
496ceb9
Compare

Resolves #7366 (FR-2824)
Summary
Migrate the resource-policy lists (Keypair / User / Project) from the legacy
pagination.extraContent+TableColumnsSettingModalcolumn-settings setup to the canonicalBAITabletableSettingsprop, so the footer renders the same[total, pagination, page size, ⚙ column-settings, ⋮ export]order as the rest of the app (UserManagement,AutoScalingRuleList, etc.).Background
The earlier version of this PR added
exportSettingstoBAITablefor the CSV-export ⋮ menu, but kept the legacypagination.extraContentbutton rendering a separate ⚙ column-settings icon. BecauseextraContentis appended afterexportSettings, the footer ended up as[..., ⋮ export, ⚙ column-settings]— opposite of every other table in the app. Reviewer pointed out the inconsistency.Changes
For each of
react/src/components/{KeypairResourcePolicyList,UserResourcePolicyList,ProjectResourcePolicyList}.tsx:useHiddenColumnKeysSetting+TableColumnsSettingModal+ theuseToggle()modal state.pagination.extraContent⚙ button._.filter(columns, …hiddenColumnKeys…)column filtering.useBAISettingUserState('table_column_overrides.<ListName>')to sourcecolumnOverrides/setColumnOverrides.BAITableviatableSettings={{ columnOverrides, onColumnOverridesChange }}(matchesUserManagement.tsx:487exactly).exportSettings={{ supportedFields, onExport }}.BAITablethen renders the canonical footer ordering automatically.Test plan
[total, pagination, page size, ⚙, ⋮]. Click ⚙ to toggle column visibility — state persists across reloads (BAI user-state). Click ⋮ → ExportCSV — downloads with the visible columns.bash scripts/verify.sh— Relay / Lint / Format / TypeScript pass for the modified files (pre-existing TS errors in unrelated files remain).🤖 Generated with Claude Code